﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Sahit.iSoilHotel.DistributedServices.MainBoundedContext.Interfaces;
using Sahit.iSoilHotel.Application.MainBoundedContext.DTO.AuthenticationAgg;
using Sahit.iSoilHotel.DistributedServices.MainBoundedContext.InstanceProviders;
using Sahit.iSoilHotel.Application.MainBoundedContext.DTO.RecordAgg;
using Sahit.iSoilHotel.Application.MainBoundedContext.Tavern.Interfaces;
using Sahit.iSoilHotel.Application.MainBoundedContext.DTO.FilterAgg;

namespace Sahit.iSoilHotel.DistributedServices.MainBoundedContext
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "TavernRecordService" in code, svc and config file together.
     [UnityInstanceProviderServiceBehavior()]
    public class TavernRecordService : ITavernRecordService
    {

         #region Members

         private readonly IRecordService recordService;

         #endregion

         #region Constructor

         public TavernRecordService(IRecordService recordService)
        {
            if (recordService == null)
                throw new ArgumentNullException("TavernRecordService");

            this.recordService = recordService;
        }

        #endregion

        public List<RecordDTO> GetRecords(RecordFilterDTO filter)
        {
            return recordService.GetRecords(filter);
        }

        public RecordDTO Reserve(RecordDTO record)
        {
            recordService.Reserve(record);
            return new RecordDTO();
        }

        public RecordDTO CheckIn(RecordDTO record)
        {
            recordService.CheckIn(record);
            return new RecordDTO();
        }

        public RecordDTO CheckOut(RecordDTO record)
        {
            recordService.CheckOut(record);
            return new RecordDTO();
        }
    }
}
